package Game;

import org.testng.annotations.AfterClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeClass;
import org.testng.AssertJUnit;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Optional;
import org.testng.AssertJUnit;
import org.testng.annotations.Parameters;
import org.testng.Assert;
import org.testng.annotations.Test;

@Test
public class TestRockPaperScissors {
	
	private RockPaperScissors rps;
	
	@BeforeClass
	void setUpClass()
	{
		rps = new RockPaperScissors();
	}
	
	@AfterClass
	void tearDownClass()
	{
		rps = null;
	}
/*	
	@Parameters({"PAPER", "ROCK"})
	@Test
	public void testWinPlay(@Optional("PAPER") String p1, @Optional("ROCK") String p2)
	{
		AssertJUnit.assertEquals(rps.play(RPSEnum.valueOf(p1), RPSEnum.valueOf(p2)), Result.WIN);
	}
	*/
	@DataProvider(name = "test1")
	public Object[][] createData1() {
	 return new Object[][] {
	   { "PAPER", "ROCK" },
	 };
	}
	
	@Test(dataProvider = "test1")
	public void testWinPlay2(String p1,String p2)
	{
		AssertJUnit.assertEquals(rps.play(RPSEnum.valueOf(p1), RPSEnum.valueOf(p2)), Result.WIN);
	}


	
	/*
	 * 
	 *  Also use the @Parameters annotation to provide to your test method two chosen arguments 
	 *  for which you know that p1 should win. Assert in the code of that test method the result 
	 *  you get is the one you are expecting from the method play.
Run the test: it should fail.

	 */

}
